--[[ 编码: WMS-33-15 名称: 指定出库-新增窗口-选容器前 作者:HAN 日期:2025-1-29 级别:固定 (说明本段代码在项目中不太会变化) 函数: BeforeSelectCNTR 功能: 弹出货品查询面板 更改记录: --]] json = require ("json") mobox = require ("OILua_JavelinExt") m3 = require("oi_base_mobox") function BeforeSelectCNTR ( strLuaDEID ) local nRet, strRetInfo nRet, strRetInfo = mobox.getCurEditDataObjAttr( strLuaDEID, "S_WH_CODE", "S_AREA_CODE" ) if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "获取当前编辑属性失败! "..strRetInfo ) end local obj_attrs = json.decode( strRetInfo ) local wh_code = lua.Get_StrAttrValue( obj_attrs[1].value ) if ( wh_code == '') then mobox.setInfo( strLuaDEID, "请先选择一个仓库" ) return end local area_code = lua.Get_StrAttrValue( obj_attrs[2].value ) if ( area_code == '') then mobox.setInfo( strLuaDEID, "请先选择一个库区" ) return end local strCondition = "S_CODE IN ( select S_CNTR_CODE from TN_Loc_Container with (NOLOCK) where S_LOC_CODE in ".. "(select S_CODE from TN_Location with (NOLOCK) where S_AREA_CODE = '"..area_code.."'))" local action = { { action_type = "open_data_query_dlg", value = { multi_choice = false, cls_name = "Container", grid_style = "选择面板用", condition = strCondition, order = "S_CODE" } } } nRet, strRetInfo = mobox.setAction( strLuaDEID, lua.table2str(action) ) if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), strRetInfo ) end end